package com.kirayous.gulimall.product.feign.fallback;

import com.kirayous.common.exception.BizCodeEnume;
import com.kirayous.common.utils.R;
import com.kirayous.gulimall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author KiraYous
 * @version V1.0
 * @Package com.kirayous.gulimall.product.feign.fallback
 * @date 2022/4/4 1:02
 */

//这里做一个熔断处理
@Slf4j
@Component
public class SeckillFeignServiceFallBack implements SeckillFeignService {
    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用...getSkuSeckillInfo");
        return R.error(BizCodeEnume.TOO_MANY_REQUEST.getCode(),BizCodeEnume.TOO_MANY_REQUEST.getMsg());
    }
}